ComponentOne SuperTooltip for WinForms
C1.Win.4.8 Assembly / C1.Win.Drawing Namespace / StringRendererGDI Class / HighlightSubstring Method / HighlightSubstring(Graphics,Font,TextFormatFlags,Color,Rectangle,String,Color,IList<CharacterRange>) Method
The device context in which to draw the text.
The System.Drawing.Font to apply to the drawn text.
The text layout information.
The System.Drawing.Color to apply to the drawn text.
The System.Drawing.Rectangle that represents the bounds of the text.
The text to draw.
The highlight System.Drawing.Color of substrings.
Positions and lengths of all occurrences of substrings to highlight.

In This Topic
    HighlightSubstring(Graphics,Font,TextFormatFlags,Color,Rectangle,String,Color,IList<CharacterRange>) Method
    In This Topic
    Draws text and highlight a parts of that text with a special background.
    Syntax
    'Declaration
     
    Public Overloads Shared Sub HighlightSubstring( _
       ByVal graphics As System.Drawing.Graphics, _
       ByVal font As System.Drawing.Font, _
       ByVal textFormatFlags As System.Windows.Forms.TextFormatFlags, _
       ByVal foreColor As System.Drawing.Color, _
       ByVal bounds As System.Drawing.Rectangle, _
       ByVal text As System.String, _
       ByVal highlightColor As System.Drawing.Color, _
       ByVal substringRanges As System.Collections.Generic.IList(Of CharacterRange) _
    ) 
    public static void HighlightSubstring( 
       System.Drawing.Graphics graphics,
       System.Drawing.Font font,
       System.Windows.Forms.TextFormatFlags textFormatFlags,
       System.Drawing.Color foreColor,
       System.Drawing.Rectangle bounds,
       System.string text,
       System.Drawing.Color highlightColor,
       System.Collections.Generic.IList<CharacterRange> substringRanges
    )

    Parameters

    graphics
    The device context in which to draw the text.
    font
    The System.Drawing.Font to apply to the drawn text.
    textFormatFlags
    The text layout information.
    foreColor
    The System.Drawing.Color to apply to the drawn text.
    bounds
    The System.Drawing.Rectangle that represents the bounds of the text.
    text
    The text to draw.
    highlightColor
    The highlight System.Drawing.Color of substrings.
    substringRanges
    Positions and lengths of all occurrences of substrings to highlight.
    See Also